'use strict';

const Controller = require('egg').Controller;

class ChumController extends Controller {
  async index() {
    const {ctx} = this
    var {name,age,sex,like} = ctx.request.body
    var db =  this.app.mongodb;
    await db.collection("chum").insertOne({name,age,sex,like})
    await ctx.render("addChum")
  }
}

module.exports = ChumController;